//
//  MYYChangeInforViewCell.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/10/23.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYYChangeInforViewCell.h"
#import "MYY_Me_Macro.h"

@interface MYYChangeInforViewCell()
@property(nonatomic, strong) UIView *hengLine;

@end

@implementation MYYChangeInforViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"MYYChangeInforViewCell";
    MYYChangeInforViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[MYYChangeInforViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
        cell.selectionStyle          = UITableViewCellSelectionStyleNone;
        cell.backgroundColor         = [UIColor whiteColor];
    }
    
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initCreatUI];
        
    }
    return self;
}

-(void)initCreatUI
{
    [self addSubview:self.titleLabel];
    [self addSubview:self.hengLine];
    [self addSubview:self.arrowImageView];
    [self addSubview:self.contentLabel];
    [self addSubview:self.titiTextFild];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self).with.offset(15);
        make.height.mas_equalTo(MYYMe_cert_H);
        make.width.mas_equalTo(MYYMe_Resume_head_H);
        
    }];
    
    [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).with.offset(-20);
        make.centerY.equalTo(self);
        make.width.equalTo(@8);
        make.height.equalTo(@13);
    }];
    
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).with.offset(20+MYYMe_cell_H+5);
        make.centerY.equalTo(self);
        make.height.mas_equalTo(MYYMe_cert_H);
        make.right.equalTo(self).with.offset(-50);
        
    }];
    
    [_hengLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.width.equalTo(self);
        make.left.equalTo(self).with.offset(0);
        make.height.equalTo(@0.5);
        make.right.equalTo(self.mas_right).with.offset(0);
    }];
    
    [_titiTextFild mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).with.offset(20+MYYMe_cell_H+5);
        make.centerY.equalTo(self);
        make.height.mas_equalTo(MYYMe_cert_H);
        make.right.equalTo(self).with.offset(-50);
        
    }];
    
}
- (UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.font = MYYFont(15.0f);
        _titleLabel.numberOfLines = 1;
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.textColor = MYYtitleColor;
    }
    return _titleLabel;
}

- (UILabel *)contentLabel
{
    if (_contentLabel == nil) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = MYYFont(15.0f);
        _contentLabel.numberOfLines = 1;
        _contentLabel.textAlignment = NSTextAlignmentLeft;
        _contentLabel.textColor =  MYYColorFromRGB(0xa6a6a6);
    }
    return _contentLabel;
}


- (UIImageView *)arrowImageView
{
    if (_arrowImageView == nil) {
        _arrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"youxiangjian"]];
        _arrowImageView.backgroundColor = [UIColor clearColor];
    }
    return _arrowImageView;
}

- (UIView *)hengLine
{
    if (_hengLine == nil) {
        _hengLine = [[UIView alloc] init];
        _hengLine.backgroundColor =MYYlineColor;
        //        _hengLine.backgroundColor =[UIColor redColor];
    }
    return _hengLine;
}

- (UITextField *)titiTextFild
{
    if (_titiTextFild == nil) {
        _titiTextFild = [[UITextField alloc] init];
        _titiTextFild.font =MYYFont(15.0f);
        _titiTextFild.textColor = MYYColorFromRGB(0xa6a6a6);
        _titiTextFild.returnKeyType =UIReturnKeyDone;
       // _titiTextFild.keyboardType =UIKeyboardTypeNumberPad;
    }
    return _titiTextFild;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
